import request from '@/utils/request'
import requestPulic from '@/utils/requestPulic'

import { EnumsReq, EnumsRes, Violation } from './interface'

// 查询枚举列表
export const Enums = (data: EnumsReq) => {
  return request<EnumsRes[]>({
    url: '/wajib/admin/investigation/enums',
    method: 'get',
    params: data,
    repeat_request_cancel: false,
  })
}

// 查询机构调查员列表
export const Users = () => {
  return request<any>({
    url: '/wajib/admin/investigation/users',
    method: 'post',
    repeat_request_cancel: false,
  })
}

// 查询机构违规单号
export const Violations = () => {
  return request<any>({
    url: '/wajib/admin/investigation/violations',
    method: 'post',
    repeat_request_cancel: false,
  })
}

// Create
export const Create = (data: Partial<Violation>) => {
  return request<any>({
    url: '/wajib/admin/investigation/create',
    method: 'post',
    data,
    repeat_request_cancel: false,
  })
}

// 验证码设备
export const Check = () => {
  return request<any>({
    url: '/wajib/admin/investigation/check',
    method: 'get',
    repeat_request_cancel: false,
  })
}

// OCR
export const Ocr = (data: any) => {
  return requestPulic<any>({
    url: '/wajib/api/file/ocr',
    method: 'post',
    data,
    repeat_request_cancel: false,
  })
}
